﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using StockTrader.FrontEnd.MarketViewer.DAL;
using LoanMonitor.Utils;
using MortgageMonitor.Forms;

namespace LoanMonitor
{
    public partial class Navigator : Form
    {
        public Navigator()
        {
            InitializeComponent();
        }

        private void Navigator_Load(object sender, EventArgs e)
        {
        }

        private void lstNavigation_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lstNavigation.SelectedItems.Count > 0)
            {
                switch (lstNavigation.SelectedItems[0].Text)
                {
                    case "Đánh giá tài sản":
                        foreach (Form frm in this.MdiChildren)
                            frm.Close();

                        AssestEstimate asset = new AssestEstimate();
                        asset.MdiParent = this;
                        asset.Show();
                        break;
                    case "Hợp đồng hợp tác":
                        foreach (Form frm in this.MdiChildren)
                            frm.Close();

                        frmCreateAgreement agree = new frmCreateAgreement();
                        agree.MdiParent = this;
                        agree.Show();
                        break;
                    case "Tạo phụ lục hợp đồng":
                        foreach (Form frm in this.MdiChildren)
                            frm.Close();

                        frmMortgage mgg = new frmMortgage();
                        mgg.MdiParent = this;
                        mgg.Show();
                        break;
                    case "Thanh lý phụ lục HĐ":
                        foreach (Form frm in this.MdiChildren)
                            frm.Close();

                        frmLiquidate lqd = new frmLiquidate();
                        lqd.MdiParent = this;
                        lqd.Show();
                        break;
                    case "Khách hàng":
                        frmCustomerManager customer = new frmCustomerManager();
                        customer.ShowDialog();
                        break;
                    case "Quản lý phí":
                        frmFee fee = new frmFee();
                        fee.ShowDialog();
                        break;
                    case "Nhập tỷ lệ chiết khấu":
                        DataConvertion cvt = new DataConvertion();
                        cvt.ShowDialog();
                        break;
                    case "Thông tin khách hàng":
                        frmTaskManager tasks = new frmTaskManager();
                        tasks.ShowDialog();
                        break;
                    case "Cập nhật vay tích lũy":
                        frmAccumulateMortgage accMort = new frmAccumulateMortgage();
                        accMort.ShowDialog();
                        break;
                    default:
                        break;
                }
            }
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
